import { NextResponse } from 'next/server'
import prisma from '@/lib/prisma'

export async function GET() {
  try {
    const user = await prisma.user.findUnique({
      where: {
        email: 'admin@example.com'
      },
      select: {
        id: true,
        email: true,
        role: true,
        // 不要选择 password
      }
    })

    return NextResponse.json({ user })
  } catch (error) {
    return NextResponse.json({ error: '查询失败' }, { status: 500 })
  }
} 